Skip to content

Conversation

karthick-murugan
Copy link
Contributor

@karthick-murugan karthick-murugan commented Apr 22, 2025

Fixes #81

This PR addresses #81 – Give user alert to confirm browser refresh by adding a browser-level confirmation dialog that triggers when a user attempts to refresh or close the Playground window/tab. This helps prevent accidental data loss or session interruption due to unintended refreshes.

Changes Introduced

  • Added a beforeunload event listener to the Playground UI.
  • The event prompts a native browser confirmation dialog, asking the user to confirm if they really want to refresh or navigate away from the page.
  • Ensures smoother UX by reducing unintentional disruptions during usage.

🧪 Testing Instructions

  • Start the Playground.
  • Interact with any UI component to simulate an active session.
  • Try refreshing the page or closing the browser tab.
  • A browser-native alert will now ask for confirmation.

Sceenshot

confirm_alert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Inbox
Development

Successfully merging this pull request may close these issues.

Give user alert to confirm browser refresh
1 participant